/* Layout.css - 统一布局样式 */

/* 全局重置和基础样式 */
* {
  box-sizing: border-box;
}

.layout-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

/* Header样式 */
.layout-header {
  background-color: #282c34;
  color: white;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  width: 100%;
  left: 0;
  right: 0;
}

.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.project-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  margin: 0 40px;
}

.main-nav {
  width: 100%;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
}

.nav-item {
  height: 64px;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active .nav-link {
  color: #61dafb;
  border-bottom-color: #61dafb;
  background-color: rgba(97, 218, 251, 0.1);
}

.nav-icon {
  font-size: 16px;
}

.nav-label {
  font-size: 14px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-switcher {
  display: flex;
  align-items: center;
}

.user-status {
  display: flex;
  align-items: center;
  position: relative;
}

.user-info {
  position: relative;
  display: inline-block;
}

/* 用户下拉触发器 */
.user-dropdown-trigger {
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  white-space: nowrap;
  min-width: 120px;
  justify-content: center;
}

.user-dropdown-trigger:hover,
.user-dropdown-trigger.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-greeting {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.dropdown-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  transition: transform 0.3s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

/* 下拉菜单 */
.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1001;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-label {
  font-size: 14px;
  color: #333;
  width: 100%;
}

.dropdown-divider {
  height: 1px;
  background-color: #e8e8e8;
  margin: 4px 0;
}

.dropdown-button {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: #ff4d4f;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s;
}

.dropdown-button:hover {
  color: #ff7875;
}

.logout-btn {
  background-color: transparent;
  color: #ff4d4f;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  white-space: nowrap;
}

.logout-btn:hover {
  color: #ffffff;
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.login-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.3s;
  font-size: 14px;
  white-space: nowrap;
}

.login-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* 主内容区域样式 */
.layout-content {
  flex: 1;
  padding: 24px;
  transition: padding 0.3s ease;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 24px;
  min-height: 600px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

/* Footer样式 */
.layout-footer {
  background-color: #282c34;
  color: rgba(255, 255, 255, 0.65);
  padding: 24px 0;
  text-align: center;
  margin-top: auto;
  width: 100%;
  left: 0;
  right: 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-content p {
  margin: 0;
  font-size: 14px;
}

/* 响应式设计 - 超大屏幕 (1440px+) */
@media (min-width: 1440px) {
  .layout-header {
    padding: 0 48px;
  }
  
  .layout-content {
    padding: 32px;
  }
  
  .content-wrapper {
    max-width: 1400px;
    padding: 32px;
  }
  
  .project-name {
    font-size: 24px;
  }
  
  .nav-menu {
    gap: 32px;
  }
  
  .nav-link {
    padding: 0 24px;
  }
  
  .nav-label {
    font-size: 16px;
  }
}

/* 响应式设计 - 大屏幕 (1200px-1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
  .layout-header {
    padding: 0 32px;
  }
  
  .nav-menu {
    gap: 24px;
  }
}

/* 响应式设计 - 平板横屏 (992px-1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .layout-header {
    padding: 0 24px;
  }
  
  .header-center {
    margin: 0 24px;
  }
  
  .nav-menu {
    gap: 16px;
  }
}

/* 响应式设计 - 平板竖屏 (768px-991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .layout-header {
    padding: 0 20px;
  }
  
  .header-center {
    margin: 0 16px;
  }
  
  .nav-menu {
    gap: 12px;
  }
  
  .project-name {
    font-size: 18px;
  }
  
  .layout-content {
    padding: 20px;
  }
  
  .content-wrapper {
    padding: 20px;
  }
}

/* 响应式设计 - 手机横屏 (640px-767px) */
@media (max-width: 767px) {
  .layout-header {
    padding: 0 16px;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-center {
    width: 100%;
    order: 3;
    margin: 0;
  }
  
  .nav-menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
  }
  
  .nav-item {
    height: 40px;
  }
  
  .nav-link {
    padding: 0 12px;
    font-size: 12px;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .layout-content {
    padding: 16px;
  }
  
  .content-wrapper {
    padding: 16px;
    min-height: 400px;
  }
  
  .project-name {
    font-size: 18px;
  }
}

/* 响应式设计 - 手机竖屏 (小于640px) */
@media (max-width: 639px) {
  .project-name {
    font-size: 16px;
  }
  
  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  
  .user-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  
  .user-greeting {
    font-size: 12px;
  }
  
  .layout-content {
    padding: 12px;
  }
  
  .content-wrapper {
    padding: 12px;
    min-height: 300px;
  }
  
  .footer-content {
    padding: 0 16px;
  }
}
